package com.master.chat.llm.locallm.dify.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

// "usage": {
//            "prompt_tokens": 1033,
//            "prompt_unit_price": "0.001",
//            "prompt_price_unit": "0.001",
//            "prompt_price": "0.0010330",
//            "completion_tokens": 128,
//            "completion_unit_price": "0.002",
//            "completion_price_unit": "0.001",
//            "completion_price": "0.0002560",
//            "total_tokens": 1161,
//            "total_price": "0.0012890",
//            "currency": "USD",
//            "latency": 0.7682376249867957
//        },
public class DifyMetadata {
    private DifyUsage usage;
    @JsonProperty("retriever_resources")
    private RetrieverResource[] retrieverResources;
}

//{
//                "position": 1,
//                "dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb",
//                "dataset_name": "iPhone",
//                "document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00",
//                "document_name": "iPhone List",
//                "segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a",
//                "score": 0.98457545,
//                "content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""
//            }
class RetrieverResource {
    private int position;
    @JsonProperty("dataset_id")
    private String datasetId;
    @JsonProperty("dataset_name")
    private String datasetName;
    @JsonProperty("document_id")
    private String documentId;
    @JsonProperty("document_name")
    private String documentName;
    @JsonProperty("segment_id")
    private String segmentId;
    private double score;
    private String content;
}

class DifyUsage {
    @JsonProperty("prompt_tokens")
    private int promptTokens;
    @JsonProperty("prompt_unit_price")
    private String promptUnitPrice;
    @JsonProperty("prompt_price_unit")
    private String promptPriceUnit;
    @JsonProperty("prompt_price")
    private String promptPrice;
    @JsonProperty("completion_tokens")
    private int completionTokens;
    @JsonProperty("completion_unit_price")
    private String completionUnitPrice;
    @JsonProperty("completion_price_unit")
    private String completionPriceUnit;
    @JsonProperty("completion_price")
    private String completionPrice;
    @JsonProperty("total_tokens")
    private int totalTokens;
    @JsonProperty("total_price")
    private String totalPrice;
    private String currency;
    private double latency;
}
